package org.shj.basic;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Shen Huang Jian
 * @date 2019-08-09 13:32
 */
public class StreamDemo {

    public static void main(String[] args){
        List<Integer> numbers = Arrays.asList(1,2,3,4,5,6);
        List<Integer> filtered = numbers.stream().filter(item -> item > 4).collect(Collectors.toList());

        for(Integer item : filtered){
            System.out.println(item);
        }
    }
}
